1. Field of the Invention
The invention relates to the field of audio signal clipping.
2. Prior Art
Clipping of audio waveforms has proved to be a valuable part of analog audio processing systems designed to reduce the peak-to-average ratio of audio with minimal audible side effects. This technology dates back at least to the 1940s.
When one realizes such a processing system in a sample-data (digital) domain, a number of problems occur that are not present in an analog realization. First is the problem of aliasing. Clipping ordinarily introduces harmonics of the signal not present in the original. The frequency of these harmonics can be higher than the Nyquist frequency, so that they alias back into the baseband. Because the aliased harmonics are generally harmonically unrelated to the frequencies that generated them, such aliased harmonics can be very offensive to the ear.
A further problem occurs when clipping is used to control the peak modulation of an analog transmission channel. Because the digital part of the system is only aware of samples taken from the analog input at certain times, it is highly improbable that any one sample will occur at the peak value of the analog input to such a digital system. While the peak value can be reconstructed from the samples, it must be done by the familiar process of passing each sample through a lowpass filter and observing the output of the lowpass filter in continuous time. Thus, attempting digital-domain clipping by a simple operation that compares each sample to a threshold and replaces the sample value by the threshold when the sample value exceeds the threshold may not work correctly unless the operation is highly oversampled so that it approximates a continuous time system. In this case one can choose the oversampling ratio so that there is guaranteed to be a sample whose value is very close to the peak value of the source analog waveform prior to analog-to-digital (A/D) conversion. A further advantage of oversampling is that it increases the Nyquist frequency so that harmonics caused by the clipping process can be correctly represented and not subject to aliasing. Experiment had shown that 16xc3x97 oversampling is necessary to reduce errors below 1%.
Oversampling is a very well understood process that is subject to errors. Given sufficient processing power these errors can be reduced to an arbitrarily small magnitude but cannot be entirely eliminated. There is a direct tradeoff between the number of machine cycles used and the quality of the upsampling and downsampling. This is because these processes require filters to remove images caused by the upsampling process, and the flatter the passbands and deeper the stopbands of these filters, the more expensive the filters become. Therefore, if the audio to be processed is subject to oversampling, this process will inevitably distort the frequency response and will also introduce images and aliasing.
A method and apparatus for digital clipping and other processing of a clipped signal is disclosed. A signal is upsampled and then clipped in a way to provide the xe2x80x9cclippings.xe2x80x9d The xe2x80x9cclippingsxe2x80x9d are lowpass filtered and downsampled. The resultant signal is subtracted from the input signal. Optionally, the downsampled xe2x80x9cclippingsxe2x80x9d can be additionally processed.